#-*- coding:utf-8 -*-

from django.db import models
from django.contrib.auth.models import User


class Album(models.Model):
    TYPE_SIGHT = 1
    TYPE_HUMAN = 2
    TYPE_ACTIVITY = 3
    TYPE_CHOICES = (
        (TYPE_SIGHT, "风景"),
        (TYPE_HUMAN, "人文"),
        (TYPE_ACTIVITY, "活动"),
    )

    owner = models.ForeignKey(User)
    atype = models.SmallIntegerField(choices=TYPE_CHOICES)
    title = models.CharField(max_length=60)
    brief = models.CharField(max_length=1024)
    images = models.PositiveIntegerField(default=0)
    reads = models.PositiveIntegerField(default=0)
    likes = models.PositiveIntegerField(default=0)
    comments = models.PositiveIntegerField(default=0)
    createdate = models.DateTimeField(auto_now=True)


    def __unicode__(self):
        return self.title

